package com.ruoyi.web.service.impl;

import com.ruoyi.web.dto.HazardManagementDto;
import com.ruoyi.web.entity.HazardManagement;
import com.ruoyi.web.mapper.HazardManagementMapper;
import com.ruoyi.web.service.IHazardManagementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lqc
 * @since 2024-01-30
 */
@Service
public class HazardManagementServiceImpl extends ServiceImpl<HazardManagementMapper, HazardManagement> implements IHazardManagementService {

    private final HazardManagementMapper hazardManagementMapper;
    public HazardManagementServiceImpl(HazardManagementMapper hazardManagementMapper){
        this.hazardManagementMapper = hazardManagementMapper;
    }
    /**
     * 查询隐患处理
     *
     * @param id 隐患处理主键
     * @return 隐患处理
     */
    @Override
    public HazardManagementDto selectHazardManagementById(Long id)
    {
        return hazardManagementMapper.selectHazardManagementById(id);
    }

    /**
     * 查询隐患处理列表
     *
     * @param hazardManagement 隐患处理
     * @return 隐患处理
     */
    @Override
    public List<HazardManagementDto> selectHazardManagementList(HazardManagement hazardManagement)
    {
        return hazardManagementMapper.selectHazardManagementList(hazardManagement);
    }

    /**
     * 新增隐患处理
     *
     * @param hazardManagement 隐患处理
     * @return 结果
     */
    @Override
    public int insertHazardManagement(HazardManagement hazardManagement)
    {
        return hazardManagementMapper.insertHazardManagement(hazardManagement);
    }

    /**
     * 修改隐患处理
     *
     * @param hazardManagement 隐患处理
     * @return 结果
     */
    @Override
    public int updateHazardManagement(HazardManagement hazardManagement)
    {
        return hazardManagementMapper.updateHazardManagement(hazardManagement);
    }

    /**
     * 批量删除隐患处理
     *
     * @param ids 需要删除的隐患处理主键
     * @return 结果
     */
    @Override
    public int deleteHazardManagementByIds(Long[] ids)
    {
        return hazardManagementMapper.deleteHazardManagementByIds(ids);
    }

    /**
     * 删除隐患处理信息
     *
     * @param id 隐患处理主键
     * @return 结果
     */
    @Override
    public int deleteHazardManagementById(Long id)
    {
        return hazardManagementMapper.deleteHazardManagementById(id);
    }
}
